﻿angular.module('angle').config(['$stateProvider', '$locationProvider', '$urlRouterProvider', 'RouteHelpersProvider',
function ($stateProvider, $locationProvider, $urlRouterProvider, helper) {
    'use strict';

    // Set the following to true to enable the HTML5 Mode
    // You may have to set <base> tag in index and a routing configuration in your server
    $locationProvider.html5Mode(false);

    // defaults to dashboard
    $urlRouterProvider.otherwise('/admin/login');

    // 
    // Application Routes
    // -----------------------------------   
    $stateProvider

          


      .state('app', {
          url: '/app',
          abstract: true,
          templateUrl: helper.basepath('app.html'),
          controller: 'AppController',
          resolve: helper.resolveFor('fastclick', 'modernizr', 'icons', 'screenfull', 'animo', 'sparklines', 'slimscroll', 'classyloader', 'toaster', 'whirl'),
          data: {
              requireLogin: false
          }
      })

      .state('app.dashboard', {
          url: '/dashboard',
          title: 'Dashboard',
          templateUrl: helper.basepath(' .html'),
          resolve: helper.resolveFor('flot-chart', 'flot-chart-plugins'),
          data: {
              requireLogin: false
          }
      })

          //  .state('app.products', {
          //      url: '/products',
          //      title: 'Products',
          //      templateUrl: '/product/list',
          //      resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
          //  ,
          //      data: {
          //          requireLogin: false
          //      }
          //  })
          //.state('app.product-view', {
          //    url: '/product/:Sku',
          //    title: 'Product View',
          //    templateUrl: '/views/product/product.html',
          //    resolve: helper.resolveFor('xeditable', 'localytics.directives')
          //})

      .state('app.buttons', {
          url: '/buttons',
          title: 'Buttons',
          templateUrl: helper.basepath('buttons.html')
      })
      .state('app.colors', {
          url: '/colors',
          title: 'Colors',
          templateUrl: helper.basepath('colors.html')
      })
      .state('app.localization', {
          url: '/localization',
          title: 'Localization',
          templateUrl: helper.basepath('localization.html')
      })
      .state('app.infinite-scroll', {
          url: '/infinite-scroll',
          title: 'Infinite Scroll',
          templateUrl: helper.basepath('infinite-scroll.html'),
          resolve: helper.resolveFor('infinite-scroll')
      })
      .state('app.navtree', {
          url: '/navtree',
          title: 'Nav Tree',
          templateUrl: helper.basepath('nav-tree.html'),
          resolve: helper.resolveFor('angularBootstrapNavTree')
      })
      .state('app.nestable', {
          url: '/nestable',
          title: 'Nestable',
          templateUrl: helper.basepath('nestable.html'),
          resolve: helper.resolveFor('ng-nestable')
      })
      .state('app.sortable', {
          url: '/sortable',
          title: 'Sortable',
          templateUrl: helper.basepath('sortable.html'),
          resolve: helper.resolveFor('htmlSortable')
      })
      .state('app.notifications', {
          url: '/notifications',
          title: 'Notifications',
          templateUrl: helper.basepath('notifications.html'),
          controller: 'NotificationController'
      })
      .state('app.carousel', {
          url: '/carousel',
          title: 'Carousel',
          templateUrl: helper.basepath('carousel.html'),
          resolve: helper.resolveFor('angular-carousel')
      })
      .state('app.ngdialog', {
          url: '/ngdialog',
          title: 'ngDialog',
          templateUrl: helper.basepath('ngdialog.html'),
          resolve: angular.extend(helper.resolveFor('ngDialog'), {
              tpl: function () { return { path: helper.basepath('ngdialog-template.html') }; }
          }),
          controller: 'DialogIntroCtrl'
      })
      .state('app.interaction', {
          url: '/interaction',
          title: 'Interaction',
          templateUrl: helper.basepath('interaction.html')
      })
      .state('app.spinners', {
          url: '/spinners',
          title: 'Spinners',
          templateUrl: helper.basepath('spinners.html'),
          resolve: helper.resolveFor('loaders.css', 'spinkit')
      })
      .state('app.animations', {
          url: '/animations',
          title: 'Animations',
          templateUrl: helper.basepath('animations.html')
      })
      .state('app.dropdown-animations', {
          url: '/dropdown-animations',
          title: 'Dropdown Animations',
          templateUrl: helper.basepath('dropdown-animations.html')
      })
      .state('app.panels', {
          url: '/panels',
          title: 'Panels',
          templateUrl: helper.basepath('panels.html')
      })
      .state('app.portlets', {
          url: '/portlets',
          title: 'Portlets',
          templateUrl: helper.basepath('portlets.html'),
          resolve: helper.resolveFor('jquery-ui', 'jquery-ui-widgets')
      })
      .state('app.maps-google', {
          url: '/maps-google',
          title: 'Maps Google',
          templateUrl: helper.basepath('maps-google.html'),
          resolve: helper.resolveFor('loadGoogleMapsJS', function () { return loadGoogleMaps(); }, 'ui.map')
      })
      .state('app.maps-vector', {
          url: '/maps-vector',
          title: 'Maps Vector',
          templateUrl: helper.basepath('maps-vector.html'),
          controller: 'VectorMapController',
          resolve: helper.resolveFor('vector-map', 'vector-map-maps')
      })
      .state('app.grid', {
          url: '/grid',
          title: 'Grid',
          templateUrl: helper.basepath('grid.html')
      })
      .state('app.grid-masonry', {
          url: '/grid-masonry',
          title: 'Grid Masonry',
          templateUrl: helper.basepath('grid-masonry.html')
      })
      .state('app.grid-masonry-deck', {
          url: '/grid-masonry-deck',
          title: 'Grid Masonry',
          templateUrl: helper.basepath('grid-masonry-deck.html'),
          resolve: helper.resolveFor('spinkit', 'akoenig.deckgrid')
      })
      .state('app.typo', {
          url: '/typo',
          title: 'Typo',
          templateUrl: helper.basepath('typo.html')
      })
      .state('app.icons-font', {
          url: '/icons-font',
          title: 'Icons Font',
          templateUrl: helper.basepath('icons-font.html')
      })
      .state('app.icons-weather', {
          url: '/icons-weather',
          title: 'Icons Weather',
          templateUrl: helper.basepath('icons-weather.html')
      })
      .state('app.form-standard', {
          url: '/form-standard',
          title: 'Form Standard',
          templateUrl: helper.basepath('form-standard.html')
      })
      .state('app.form-extended', {
          url: '/form-extended',
          title: 'Form Extended',
          templateUrl: helper.basepath('form-extended.html'),
          resolve: helper.resolveFor('codemirror', 'moment', 'taginput', 'inputmask', 'localytics.directives', 'ui.bootstrap-slider', 'ngWig', 'filestyle', 'textAngular', 'textAngularSetup')
      })
      .state('app.form-validation', {
          url: '/form-validation',
          title: 'Form Validation',
          templateUrl: helper.basepath('form-validation.html'),
          resolve: helper.resolveFor('ui.select', 'taginput', 'inputmask', 'localytics.directives')
      })
      .state('app.form-parsley', {
          url: '/form-parsley',
          title: 'Form Validation - Parsley',
          templateUrl: helper.basepath('form-parsley.html'),
          resolve: helper.resolveFor('parsley')
      })
      .state('app.form-wizard', {
          url: '/form-wizard',
          title: 'Form Wizard',
          templateUrl: helper.basepath('form-wizard.html'),
          resolve: helper.resolveFor('parsley')
      })
      .state('app.form-upload', {
          url: '/form-upload',
          title: 'Form upload',
          templateUrl: helper.basepath('form-upload.html'),
          resolve: helper.resolveFor('angularFileUpload', 'filestyle')
      })
      .state('app.form-xeditable', {
          url: '/form-xeditable',
          templateUrl: helper.basepath('form-xeditable.html'),
          resolve: helper.resolveFor('xeditable')
      })
      .state('app.form-imagecrop', {
          url: '/form-imagecrop',
          templateUrl: helper.basepath('form-imagecrop.html'),
          resolve: helper.resolveFor('ngImgCrop', 'filestyle')
      })
      .state('app.form-uiselect', {
          url: '/form-uiselect',
          templateUrl: helper.basepath('form-uiselect.html'),
          controller: 'uiSelectController',
          resolve: helper.resolveFor('ui.select')
      })
      .state('app.chart-flot', {
          url: '/chart-flot',
          title: 'Chart Flot',
          templateUrl: helper.basepath('chart-flot.html'),
          resolve: helper.resolveFor('flot-chart', 'flot-chart-plugins')
      })
      .state('app.chart-radial', {
          url: '/chart-radial',
          title: 'Chart Radial',
          templateUrl: helper.basepath('chart-radial.html'),
          resolve: helper.resolveFor('classyloader')
      })
      .state('app.chart-js', {
          url: '/chart-js',
          title: 'Chart JS',
          templateUrl: helper.basepath('chart-js.html'),
          resolve: helper.resolveFor('chartjs')
      })
      .state('app.chart-rickshaw', {
          url: '/chart-rickshaw',
          title: 'Chart Rickshaw',
          templateUrl: helper.basepath('chart-rickshaw.html'),
          resolve: helper.resolveFor('angular-rickshaw')
      })
      .state('app.chart-morris', {
          url: '/chart-morris',
          title: 'Chart Morris',
          templateUrl: helper.basepath('chart-morris.html'),
          resolve: helper.resolveFor('morris')
      })
      .state('app.chart-chartist', {
          url: '/chart-chartist',
          title: 'Chart Chartist',
          templateUrl: helper.basepath('chart-chartist.html'),
          resolve: helper.resolveFor('angular-chartist')
      })
      .state('app.table-standard', {
          url: '/table-standard',
          title: 'Table Standard',
          templateUrl: helper.basepath('table-standard.html')
      })
      .state('app.table-extended', {
          url: '/table-extended',
          title: 'Table Extended',
          templateUrl: helper.basepath('table-extended.html')
      })
      .state('app.table-datatable', {
          url: '/table-datatable',
          title: 'Table Datatable',
          templateUrl: helper.basepath('table-datatable.html'),
          resolve: helper.resolveFor('datatables')
      })
      .state('app.table-xeditable', {
          url: '/table-xeditable',
          templateUrl: helper.basepath('table-xeditable.html'),
          resolve: helper.resolveFor('xeditable')
      })
      .state('app.table-ngtable', {
          url: '/table-ngtable',
          templateUrl: helper.basepath('table-ngtable.html'),
          resolve: helper.resolveFor('ngTable', 'ngTableExport')
      })
      .state('app.table-nggrid', {
          url: '/table-nggrid',
          templateUrl: helper.basepath('table-ng-grid.html'),
          resolve: helper.resolveFor('ngGrid')
      })
      .state('app.table-uigrid', {
          url: '/table-uigrid',
          templateUrl: helper.basepath('table-uigrid.html'),
          resolve: helper.resolveFor('ui.grid')
      })
      .state('app.table-angulargrid', {
          url: '/table-angulargrid',
          templateUrl: helper.basepath('table-angulargrid.html'),
          resolve: helper.resolveFor('angularGrid')
      })
      .state('app.timeline', {
          url: '/timeline',
          title: 'Timeline',
          templateUrl: helper.basepath('timeline.html')
      })
      .state('app.calendar', {
          url: '/calendar',
          title: 'Calendar',
          templateUrl: helper.basepath('calendar.html'),
          resolve: helper.resolveFor('jquery-ui', 'jquery-ui-widgets', 'moment', 'fullcalendar')
      })
      .state('app.invoice', {
          url: '/invoice',
          title: 'Invoice',
          templateUrl: helper.basepath('invoice.html')
      })
      .state('app.search', {
          url: '/search',
          title: 'Search',
          templateUrl: helper.basepath('search.html'),
          resolve: helper.resolveFor('moment', 'localytics.directives', 'ui.bootstrap-slider')
      })
      .state('app.todo', {
          url: '/todo',
          title: 'Todo List',
          templateUrl: helper.basepath('todo.html'),
          controller: 'TodoController'
      })
      .state('app.profile', {
          url: '/profile',
          title: 'Profile',
          templateUrl: helper.basepath('profile.html'),
          resolve: helper.resolveFor('loadGoogleMapsJS', function () { return loadGoogleMaps(); }, 'ui.map')
      })
      .state('app.code-editor', {
          url: '/code-editor',
          templateUrl: helper.basepath('code-editor.html'),
          resolve: {
              deps: helper.resolveFor('codemirror', 'ui.codemirror', 'codemirror-modes-web', 'angularBootstrapNavTree').deps,
              filetree: ["LoadTreeService", function (LoadTreeService) {
                  return LoadTreeService.get().$promise.then(function (res) {
                      return res.data;
                  });
              }]
          },
          controller: ["$rootScope", "$scope", "filetree", function ($rootScope, $scope, filetree) {
              // Set the tree data into the scope
              $scope.filetree_data = filetree;
              // Setup the layout mode 
              $rootScope.app.useFullLayout = true;
              $rootScope.app.hiddenFooter = true;
              $rootScope.app.layout.isCollapsed = true;
              // Restore layout
              $scope.$on('$destroy', function () {
                  $rootScope.app.useFullLayout = false;
                  $rootScope.app.hiddenFooter = false;
              });
          }]
      })
      .state('app.template', {
          url: '/template',
          title: 'Blank Template',
          templateUrl: helper.basepath('template.html')
      })
      .state('app.documentation', {
          url: '/documentation',
          title: 'Documentation',
          templateUrl: helper.basepath('documentation.html'),
          resolve: helper.resolveFor('flatdoc')
      })
      // Forum
      // ----------------------------------- 
      .state('app.forum', {
          url: '/forum',
          title: 'Forum',
          templateUrl: helper.basepath('forum.html')
      })
      .state('app.forum-topics', {
          url: '/forum/topics/:catid',
          title: 'Forum Topics',
          templateUrl: helper.basepath('forum-topics.html')
      })
      .state('app.forum-discussion', {
          url: '/forum/discussion/:topid',
          title: 'Forum Discussion',
          templateUrl: helper.basepath('forum-discussion.html')
      })
      // Blog
      // ----------------------------------- 
      .state('app.blog', {
          url: '/blog',
          title: 'Blog',
          templateUrl: helper.basepath('blog.html'),
          resolve: helper.resolveFor('angular-jqcloud')
      })
      .state('app.blog-post', {
          url: '/post',
          title: 'Post',
          templateUrl: helper.basepath('blog-post.html'),
          resolve: helper.resolveFor('angular-jqcloud')
      })
      .state('app.articles', {
          url: '/articles',
          title: 'Articles',
          templateUrl: helper.basepath('blog-articles.html'),
          resolve: helper.resolveFor('datatables')
      })
      .state('app.article-view', {
          url: '/article/:id',
          title: 'Article View',
          templateUrl: helper.basepath('blog-article-view.html'),
          resolve: helper.resolveFor('ui.select', 'textAngular')
      })
      // eCommerce
      // ----------------------------------- 

      //.state('app.order-view', {
      //    url: '/order-view',
      //    title: 'Order View',
      //    templateUrl: helper.basepath('ecommerce-order-view.html')
      //})

      // Mailbox
      // ----------------------------------- 
      .state('app.mailbox', {
          url: '/mailbox',
          title: 'Mailbox',
          abstract: true,
          templateUrl: helper.basepath('mailbox.html'),
          controller: 'MailboxController'
      })
      .state('app.mailbox.folder', {
          url: '/folder/:folder',
          title: 'Mailbox',
          templateUrl: helper.basepath('mailbox-inbox.html')
      })
      .state('app.mailbox.view', {
          url: "/{mid:[0-9]{1,4}}",
          title: 'View mail',
          templateUrl: helper.basepath('mailbox-view.html'),
          resolve: helper.resolveFor('ngWig')
      })
      .state('app.mailbox.compose', {
          url: '/compose',
          title: 'Mailbox',
          templateUrl: helper.basepath('mailbox-compose.html'),
          resolve: helper.resolveFor('ngWig')
      })
      // 
      // Multiple level example
      // ----------------------------------- 
      .state('app.multilevel', {
          url: '/multilevel',
          title: 'Multilevel',
          template: '<h3>Multilevel Views</h3>' + '<div class="lead ba p">View @ Top Level ' + '<div ui-view=""></div> </div>'
      })
      .state('app.multilevel.level1', {
          url: '/level1',
          title: 'Multilevel - Level1',
          template: '<div class="lead ba p">View @ Level 1' + '<div ui-view=""></div> </div>'
      })
      .state('app.multilevel.level1.item', {
          url: '/item',
          title: 'Multilevel - Level1',
          template: '<div class="lead ba p"> Menu item @ Level 1</div>'
      })
      .state('app.multilevel.level1.level2', {
          url: '/level2',
          title: 'Multilevel - Level2',
          template: '<div class="lead ba p">View @ Level 2' + '<div ui-view=""></div> </div>'
      })
      .state('app.multilevel.level1.level2.level3', {
          url: '/level3',
          title: 'Multilevel - Level3',
          template: '<div class="lead ba p">View @ Level 3' + '<div ui-view=""></div> </div>'
      })
      .state('app.multilevel.level1.level2.level3.item', {
          url: '/item',
          title: 'Multilevel - Level3 Item',
          template: '<div class="lead ba p"> Menu item @ Level 3</div>'
      })
      // 
      // Single Page Routes
      // ----------------------------------- 
      .state('page', {
          url: '/page',
          templateUrl: 'app/pages/page.html',
          resolve: helper.resolveFor('modernizr', 'icons'),
          controller: ["$rootScope", function ($rootScope) {
              $rootScope.app.layout.isBoxed = false;
          }]
      })
      .state('page.login', {
          url: '/login',
          title: "Login",
          templateUrl: 'app/pages/login.html',
          data: { requireLogin: false }
      })
      .state('page.register', {
          url: '/register',
          title: "Register",
          templateUrl: 'app/pages/register.html'
      })
      .state('page.recover', {
          url: '/recover',
          title: "Recover",
          templateUrl: 'app/pages/recover.html'
      })
      .state('page.lock', {
          url: '/lock',
          title: "Lock",
          templateUrl: 'app/pages/lock.html',
          data: { requireLogin: false },
          resolve: helper.resolveFor('lock')
      })
      .state('page.404', {
          url: '/404',
          title: "Not Found",
          templateUrl: 'app/pages/404.html'
      })
      // 
      // Horizontal layout
      // ----------------------------------- 
      .state('app-h', {
          url: '/app-h',
          abstract: true,
          templateUrl: helper.basepath('app-h.html'),
          controller: 'AppController',
          resolve: helper.resolveFor('fastclick', 'modernizr', 'icons', 'screenfull', 'animo', 'sparklines', 'slimscroll', 'classyloader', 'toaster', 'whirl')
      })
      .state('app-h.dashboard_v2', {
          url: '/dashboard_v2',
          title: 'Dashboard v2',
          templateUrl: helper.basepath('dashboard_v2.html'),
          controller: ["$rootScope", "$scope", function ($rootScope, $scope) {
              $rootScope.app.layout.horizontal = true;
              $scope.$on('$destroy', function () {
                  $rootScope.app.layout.horizontal = false;
              });
          }],
          resolve: helper.resolveFor('flot-chart', 'flot-chart-plugins')
      })










        .state('admin', {
            url: '/admin',
            templateUrl: '/admin.html',
            resolve: helper.resolveFor('modernizr', 'icons'),
            controller: ["$rootScope", function ($rootScope) {
                $rootScope.app.layout.isBoxed = false;
            }]
        })


    //demo-订单管理
        .state('app.orderInfoManage', {
            url: '/order/ordermanage',
            title: '订单管理',
            templateUrl: '/Order/OrderManage?:page:Keywords:OrderStatus:PayStatus:SendStatus',
            resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable', 'datetimepicker')
        })
        .state('app.orderInfoEdit', {
            url: '/order/orderedit/:id',
            title: '新增订单',
            templateUrl: '/Order/OrderEdit',
            resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
        })
        .state('app.orderInfo', {
            url: '/order/orderInfo/:id',
            title: '订单信息',
            templateUrl: '/Order/OrderInfo',
            resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
        })
        .state('app.sendOrder', {
            url: '/order/sendOrder',
            title: '发货单',
            templateUrl: '/Order/SendOrderList',
            resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable', 'datetimepicker')
        })

      
        .state('app.sendOrderInfo', {
            url: '/order/sendOrderInfo/:id',
            title: '订单发货',
            templateUrl: '/Order/SendOrderInfo',
            resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
        })
        .state('app.homepage', {
            url: '/index',
            title: '首页',
            templateUrl: '/Home/HomePage'
        })

        .state('admin.login', {
            url: '/login',
            title: '登录',
            templateUrl: '/Account/Login',
            data: { requireLogin: false }
        })


         //关键字自动回复
         .state('app.wxautoreply', {
             url: '/weixin/autoreply',
             title: '自动回复',
             templateUrl: '/WxSet/AutoReply',
             resolve: helper.resolveFor('taginput', 'ngDialog', 'angularFileUpload', 'localytics.directives')
         })

        .state('app.imagetext', {
            url: '/weixin/imagetext',
            title: '图文素材管理',
            templateUrl: '/WxSet/ImageTextManage',
            resolve: helper.resolveFor('ngTable', 'ngDialog')
        })
            .state('app.imagetextdetail', {
                url: '/weixin/imagetextedit?:groupid',
                title: '图文素材编辑',
                templateUrl: '/WxSet/ImageTextEdit',
                resolve: helper.resolveFor('ngDialog', 'angularFileUpload')
            })

         .state('app.wxconfig', {
             url: '/weixin/wxconfig',
             title: '微信配置',
             templateUrl: '/WxSet/WxConfig'
         })
        .state('app.systemset', {
            url: '/system/set',
            title: '基本设置',
            templateUrl: '/SystemSet/Index',
            resolve: helper.resolveFor('ngTable', 'ngDialog', 'lmlSample', 'taginput')
        })

          //自定义菜单
          .state('app.wxmenu', {
              url: '/weixin/wxmenu',
              title: '自定义菜单',
              templateUrl: '/WxSet/WxMenu',
              resolve: helper.resolveFor('ngDialog', 'angularFileUpload')
          })

        .state('app.usergroupmanage', {
            url: '/user/usergroupmanage',
            title: '权限管理',
            templateUrl: '/User/UserGroupManage',
            resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
        })

        //员工管理
        .state('app.usermanage', {
            url: '/user/usermanage',
            title: '员工管理',
            templateUrl: '/User/UserManage',
            resolve: helper.resolveFor('ngTable', 'ngDialog')
        })
        .state('app.usermanageedit', {
            url: '/user/usermanageedit/:Id',
            title: '添加修改员工',
            templateUrl: '/User/UserEdit',
            resolve: helper.resolveFor('ngTable', 'ngDialog')
        })
        .state('app.changepwd', {
            url: '/changepassword',
            title: '修改密码',
            templateUrl: '/Account/ChangePassword'
        })

        .state('app.freightManage', {
            url: '/product/freightManage',
            title: '运费管理',
            templateUrl: '/Freight/FreightManage',
            resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
        })



        //会员管理
         .state('app.memberlist', {
             url: '/member/list',
             title: '会员列表',
             templateUrl: '/member/memberlist',
             resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
         })
        .state('app.memberdetail', {
            url: '/member/detail/:id',
            title: '会员详情',
            templateUrl: '/member/memberdetail',
            resolve: helper.resolveFor('ngDialog')
        })
    .state('app.address', {
        url: '/member/address/:id',
        title: '会员地址',
        templateUrl: '/member/address',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
    })
        .state('app.paylist', {
            url: '/member/paylist/',
            title: '会员充值',
            templateUrl: '/member/paylist',
            resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'datetimepicker','ngJsTree')
        })
         .state('app.recharge', {
             url: '/member/recharge/:id',
             title: '会员资金记录',
             templateUrl: '/member/recharge',
             resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
         })
         .state('app.addrecharge', {
             url: '/member/addrecharge/:id',
             title: '增加资金记录',
             templateUrl: '/Member/AddRecharge',
             resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
         })
    .state('app.levels', {
        url: '/member/levellist',
        title: '会员等级',
        templateUrl: '/member/levellist',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
    })
    .state('app.leveldetail', {
        url: '/member/leveldetail/:id',
        title: '会员等级详情',
        templateUrl: '/member/leveldetail',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
    })


        //产品分类
       .state('app.productCategory', {
           url: '/product/productCategory',
           title: '产品分类',
           templateUrl: '/ProductCategory/ProductCategoryManage',
           resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable', 'angularFileUpload', 'lmlSample'),
           params: { ParentId: 0 },
           controller: 'ProductCategoryController'
       })

        .state('app.specType', {
            url: '/product/specType',
            title: '规格类型',
            templateUrl: '/Product/SpecTypeManage',
            resolve: helper.resolveFor('ngTable', 'ngDialog')
        })

        .state('app.specTemplate', {
            url: '/product/specTemplate',
            title: '规格模版',
            templateUrl: '/Product/SpecTemplateManage',
            resolve: helper.resolveFor('ngTable', 'ngDialog', 'lmlSample', 'taginput')
        })

        //产品管理
      .state('app.productManage', {
          url: '/product/productManage?:page:Keywords:FirstCategoryId:SecondCategoryId:IsDisplay',
          title: '产品管理',
          templateUrl: '/Product/ProductManage',
          resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable', 'jsTree', 'toaster', 'ngJsTree')
      })
      .state('app.productEdit', {
          url: '/product/productEdit?:Id:page:Keywords:FirstCategoryId:SecondCategoryId:IsDisplay',
          title: '添加/修改产品',
          templateUrl: '/Product/ProductEdit',
          resolve: helper.resolveFor('ngDialog', 'ngTable', 'ngImgCrop', 'angularFileUpload', 'parsley', 'summernote', 'jsTree', 'toaster', 'ngJsTree')
      })

        //积分商品管理
      .state('app.exchangeManage', {
          url: '/exchange/exchangeManage?:page:Keywords:IsDisplay',
          title: '积分商品管理',
          templateUrl: '/ProductExchange/ExchangeManage',
          resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
      })
      .state('app.exchangeEdit', {
          url: '/exchange/exchangeEdit?:Id:page:Keywords:IsDisplay',
          title: '添加/修改积分商品',
          templateUrl: '/ProductExchange/ExchangeEdit',
          resolve: helper.resolveFor('ngDialog', 'ngTable', 'ngImgCrop', 'angularFileUpload', 'parsley', 'summernote')
      })
        .state('app.pointOrder', {
            url: '/exchange/pointOrder',
            title: '积分订单管理',
            templateUrl: '/Order/PointOrderManage',
            resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
        })
    //评论管理
    .state('app.productComment', {
        url: '/product/productComment',
        title: '评论管理',
        templateUrl: '/Product/CommentManage',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'datetimepicker')
    })

    //轮播图
    .state('app.carouselManage', {
        url: '/product/carouselManage',
        title: '商城轮播图',
        templateUrl: '/Product/CarouselManage',
        resolve: helper.resolveFor('ngTable', 'ngDialog')
    })
    .state('app.carouselEdit', {
        url: '/product/carouselEdit?:Id',
        title: '添加/修改轮播图',
        templateUrl: '/Product/CarouselEdit',
        resolve: helper.resolveFor('ngDialog', 'angularFileUpload')
    })

    //广告位
    .state('app.adManage', {
        url: '/product/adManage',
        title: '广告位管理',
        templateUrl: '/Product/AdManage',
        resolve: helper.resolveFor('ngTable', 'ngDialog')
    })
    .state('app.adEdit', {
        url: '/product/adEdit?:Id',
        title: '添加/修改广告位',
        templateUrl: '/Product/AdEdit',
        resolve: helper.resolveFor('ngDialog', 'angularFileUpload')
    })


    .state('app.specialTopic', {
        url: '/activity/specialTopic',
        title: '专题活动',
        templateUrl: '/Activity/SpecialTopicManage',
        resolve: helper.resolveFor('datatables', 'ngDialog', 'ngTable')
    })
      .state('app.specialTopicEdit', {
          url: '/activity/specialTopicEdit/:Id',
          title: '添加修改专题',
          templateUrl: '/Activity/SpecialTopicEdit',
          resolve: helper.resolveFor('ngDialog', 'ngTable', 'ngImgCrop', 'angularFileUpload', 'parsley', 'summernote')
      })

    //秒杀活动
    .state('app.spikeActivity', {
        url: '/activity/spike',
        title: '限时抢购',
        templateUrl: '/Activity/SpikeManage',
        resolve: helper.resolveFor('ngDialog', 'ngTable', 'datetimepicker')
    })
    .state('app.spikeEdit', {
        url: '/activity/spikeEdit/:Id',
        title: '添加修改限时抢购',
        templateUrl: '/Activity/SpikeEdit',
        resolve: helper.resolveFor('ngDialog', 'ngTable', 'angularFileUpload', 'datetimepicker')
    })
    .state('app.draw', {
        url: '/draw/drawList',
        title: '积分抽奖列表',
        templateUrl: '/Draw/DrawList',
        resolve:helper.resolveFor('ngDialog','ngTable','datetimepicker')
    })
    .state('app.drawEdit', {
        url: '/draw/drawEdit/:Id',
        title: '添加/修改积分抽奖',
        templateUrl: '/Draw/DrawEdit',
        resolve: helper.resolveFor('ngDialog', 'ngTable', 'ngImgCrop', 'angularFileUpload', 'parsley', 'datetimepicker', 'summernote')
    })
    .state('app.drawRewardEdit', {
        url: '/draw/drawRewardEdit/:Id',
        title: '添加/修改奖项列表页',
        templateUrl: '/Draw/DrawRewardEdit',
        resolve:helper.resolveFor('ngDialog','ngTable')
    })
    .state('app.drawRecordList', {
        url: '/draw/drawRecordList/:Id',
        title: '查看中奖明细',
        templateUrl: '/Draw/DrawRecordList',
        resolve: helper.resolveFor('ngDialog', 'ngTable', 'datetimepicker', 'summernote')
    })
    .state('app.drawRewardEditNew', {
        url: '/draw/drawRewardEditNew/:Id/:DrawId',
        title: '添加/修改奖项',
        templateUrl: '/Draw/DrawRewardEditNew',
        resolve: helper.resolveFor('ngDialog', 'ngTable')
    })

    //一分钱活动列表
    .state('app.activityList', {
        url: '/activity/list',
        title: '一分钱活动列表',
        templateUrl: '/activity/activitylist',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
    })

          .state('app.activityteamList', {
              url: '/activity/teamlist/:Id',
              title: '一分钱团列表',
              templateUrl: '/activity/ActivityTeamList',
              resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
          })
         .state('app.activityteammembersList', {
             url: '/activity/teammemberlist/:Id',
             title: '一分钱团成员',
             templateUrl: '/activity/ActivityTeamMembersList',
             resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
         })
           .state('app.groupheadlist', {
               url: '/activity/groupheadlist/:Id',
               title: '降拼团列表',
               templateUrl: '/DropGroup/DropHeadList',
               resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
           })
          .state('app.groupmemberlist', {
              url: '/activity/groupmemberlist/:Id',
              title: '降拼团成员列表',
              templateUrl: '/DropGroup/DropMemberList',
              resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
          })

         .state('app.activityrulelist', {
             url: '/activity/activityrulelist',
             title: '活动规则列表',
             templateUrl: '/Activity/ActivitRuleyList',
             resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
         })

           .state('app.activityruleedit', {
               url: '/activity/activityruleedit/:id',
               title: '添加修改活动规则',
               templateUrl: '/Activity/ActivitRuleyEdit',
               resolve: helper.resolveFor('ngTable', 'ngDialog')
           })

    .state('app.activityEdit', {
        url: '/activity/activityEdit/:id',
        title: '添加修改专题',
        templateUrl: '/activity/activityEdit',
        resolve: helper.resolveFor('ngDialog', 'ngImgCrop', 'angularFileUpload', 'ngTable','datetimepicker')
    })
    .state('app.couponlist', {
        url: '/coupon/list',
        title: '优惠券列表',
        templateUrl: '/Coupon/CounponList',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
    })
    .state('app.couponinfo', {
        url: '/coupon/info/:id',
        title: '优惠券详情',
        templateUrl: '/Coupon/CouponInfo',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree', 'datetimepicker')
    })
    .state('app.coupondetail', {
        url: '/coupon/detail/:id',
        title: '优惠券明细',
        templateUrl: '/Coupon/CouponDetails',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'jsTree', 'toaster', 'ngJsTree')
    })

    //降拼活动列表
     .state('app.DropGroupList', {
         url: '/DropGroup/list',
         title: '降团活动列表',
         templateUrl: '/dropgroup/dropgrouplist',
         resolve: helper.resolveFor('ngTable', 'ngDialog')
     })

    .state('app.dropGroupEdit', {
        url: '/DropGroup/dropGroupEdit/:id',
        title: '添加修改降拼',
        templateUrl: '/dropgroup/dropGroupedit',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'angularFileUpload', 'datetimepicker')
    })

    .state('app.returnGoods', {
        url: '/returnGoods/list',
        title: '退货单管理',
        templateUrl: '/Order/ReturnGoodsManage',
        resolve: helper.resolveFor('ngTable', 'ngDialog', 'datetimepicker')
    })

    .state('app.returnGoodsInfo', {
        url: '/returnGoodsInfo/:id',
        title: '退货申请信息',
        templateUrl: '/Order/ReturnGoodsInfo',
        resolve: helper.resolveFor('ngTable', 'ngDialog')
    })





    // 
    // CUSTOM RESOLVES
    //   Add your own resolves properties
    //   following this object extend
    //   method
    // ----------------------------------- 
    // .state('app.someroute', {
    //   url: '/some_url',
    //   templateUrl: 'path_to_template.html',
    //   controller: 'someController',
    //   resolve: angular.extend(
    //     helper.resolveFor(), {
    //     // YOUR RESOLVES GO HERE
    //     }
    //   )
    // })
    ;


}])